#!/usr/bin/python
# -*- coding: utf-8 -*-
# @author: 高建平
# @description: 
#

def decorator_str(cls):
    def __str__(self):
        return '%s(%s)' % (
            type(self).__name__,
            ', '.join('%s=%s' % item for item in vars(self).items())
        )
    cls.__str__ = __str__
    return cls


def decorator_repr(cls):
    def __repr__(self):
        return '%s={%s})' % (
            type(self).__name__,
            ', '.join('"%s":"%s"' % item for item in vars(self).items())
        )
    cls.__repr__ = __repr__
    return cls

def decorator_json(cls):
    def __format__(self):
        return '{%s})' % (
            type(self).__name__,
            ',\n'.join('"%s":"%s"' % item for item in vars(self).items())
        )
    cls.__format__ = __format__
    return cls